package cn.itsource.basic.utli;

import com.bcloud.msg.http.HttpSender;

public class HttpSenderTest {

	public static void sendCode(String phone,String code) {
		String http;
		String uri = "http://118.31.110.194/msg/HttpBatchSendSM";//应用地址
		String account = "173123";//账号

		String pswd = "CQja01Cy";//密码
		String mobiles = phone;//手机号码，多个号码使用","分割
		String content = "测试我的验证码："+code;//短信内容
		boolean needstatus = true;//是否需要状态报告，需要true，不需要false
		String product = "852652212";//产品ID
		String extno = "888999";//扩展码
		String respType = "json";//返回json格式响应
		boolean encrypt = true;// 密码使用时间戳加密
		try {
			String returnString = HttpSender.send(uri, account, pswd, mobiles,
					content, needstatus, product, extno, respType);
			System.out.println(returnString);
			//TODO 处理返回值,参见HTTP协议文档
		} catch (Exception e) {
			//TODO 处理异常
			e.printStackTrace();
		}
	}
}
